package p20120406.jpa.dyn3.services;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * User: Rif
 * Date: 06.04.12
 */
@Service
@Transactional
public class ServiceA
{
   @PersistenceContext //(unitName = "unit")
   private EntityManager entityManager;

   public <T> T update(T o)
   {
      return o;
   }

   @Transactional
   public void persist(Object o)
   {
      entityManager.persist(o);
   }
}
